Bilateral filter was first proposed by Tomasi and Manduchi in 1998, Tomasi, C., and Manduchi, R., “Bilateral filtering for gray and color images”, In Proc. IEEE Int. Conf on Computer Vision, 836-846, 1998 and has been applied to image processing such as denoising, decomposition, stylization, etc. It is an edge-preserving and noise reducing smoothing filter. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels. The weights depend not only on spatial distance but also on the pixel value differences (or range difference), e.g. color intensity. This preserves sharp edges by systematically looping through each pixel and assigning weights to the adjacent pixels accordingly.
For an image f(ω), bilateral filtering can be described as:h(ω)=k−1(ω∫−∞∞∫−∞∞f(ξ)c(ξ,ω)s(f(ξ),f(ω))dξ  (1)with the normalizationk(ω)=∫−ω∞∫−∞∞c(ξ,ω)s(f(ξ),f(ω))dξ  (2)where c(ξ,x) measures the geometric closeness between the neighborhood center x and a nearby point ξ; and s(f(ξ),f(x)) measures the photometric similarity between x and ξ.
If invariant Gaussian filtering is employed, the c(ξ,ω) and s(f(ξ),f(ω)) can be expressed as
                              c          ⁡                      (                          ξ              ,              ω                        )                          =                  ⅇ                      -                                                            d                  ⁡                                      (                                          ξ                      ,                      ω                                        )                                                  2                                            2                ⁢                                  σ                  d                  2                                                                                        (        3        )                                          s          ⁡                      (                                          f                ⁡                                  (                  ξ                  )                                            ,                              f                ⁡                                  (                  ω                  )                                                      )                          =                  ⅇ                      -                                                            δ                  ⁡                                      (                                                                  f                        ⁡                                                  (                          ξ                          )                                                                    ,                                              f                        ⁡                                                  (                          ω                          )                                                                                      )                                                  2                                            2                ⁢                                  σ                  i                  2                                                                                        (        4        )            where c(ξ,ω)=d(ξ−ω)=∥ξ−ω∥ is the Euclidean distance between ω and ξ; and δ(a,b)=δ(a−b)=∥a−b∥ is a measure of distance between the two intensity values a and b. The parameter σd controls the influence of the spatial information while the parameter σi controls the influence of the intensity information.
In general, the bilateral filter and many of its variations are designed based on two observations of natural images:                Neighboring pixels tend to be strongly correlated. This property leads to the design of a spatial filter, i.e. c(ξ,x) which measures the geometric closeness between x and ξ.        Pixels with similar pixel values tend to be strongly correlated. This property leads to the design of a range filter, i.e. s(f(ξ),f(x)) which measures the photometric similarity between x and ξ.        
Unfortunately there are scenarios where these observations do not apply. For illustration purposes, a denoising example is provided in FIG. 1. In this figure, several dark dots appear as noise in one pepper of the image. When reconstructing the pixels of the noise contaminated region, the pixels in the dark gap region of the image are given high weights according to the range filter because of the similar pixel values. It is apparent that such a weight assignment is not appropriate. There is a need to build a filter that overcomes this problem. Prior solutions have not adequately been established in the art.